<?php defined( 'BASEPATH' ) or die( 'Restricted' );

/*
This code is copyright 2009-2010 by TMLA INC.  ALL RIGHTS RESERVED.
Please view license.txt in /tgsf_core/legal/license.txt or
http://tgWebSolutions.com/opensource/tgsf/license.txt
for complete licensing information.
*/

// see the config/config.php for the site name that is referenced in views/header.php
$metaDescription = 'ProgChat.com - a link stream view of what is interesting to computer programmers around the world.';
$windowTitle = 'link sharing for computer nerds - interesting links related to software development and information technology';
$pageTitle = 'most recent links';
//------------------------------------------------------------------------

$linksModel = load_model( 'links' );

$query = $linksModel->getFetchQuery();
$query->resultsPer( 100 );

$tag = '';

if ( ! GET()->isEmpty( 'tag' ) )
{
	$tag = trim( urldecode( GET()->tag ) );
	$tag_id = load_model( 'tag' )->fetch_id( $tag );
	$query
	->where( 'link_id in ( select link_tag_link_id from link_tag where link_tag_tag_id = :tag_id ) ' )
	->bindValue( 'tag_id', $tag_id, ptINT );
}

$rows = $query->exec()->fetchAll();

header('Content-type: application/rss+xml; charset=utf-8');


//------------------------------------------------------------------------
include view( 'rss' );

